package com.bluegalaxy.nhb.snapi.controller.api.ck;

import com.alibaba.fastjson.JSON;

import com.alibaba.fastjson.JSONObject;
import com.bluegalaxy.nhb.snservice.domain.constant.AppConstant;
import com.bluegalaxy.nhb.snservice.domain.vo.api.R;
import com.bluegalaxy.nhb.snservice.domain.vo.api.ck.TestVO;
import com.bluegalaxy.nhb.snservice.service.ck.CkTestService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
//import org.apache.commons.logging.Log;
//import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


/**
 * @Auther: nanhb
 * @Date: 2020/10/22 14:49
 * @Description:
 */
@RestController
@RequestMapping(AppConstant.APPLICATION_NAME+"/test")
@Slf4j
@Api(value = "测试", tags = "测试API模块")
public class CkTestController {

//    private static Log log = LogFactory.getLog(CkTestController.class);

    @Autowired
    private CkTestService ckTestService;

    /**
     * @param /
     * @author
     * @date 2018-02-11 9:18
     * @description :流程创建
     */
    @ResponseBody
    @PostMapping("/check")
    @ApiOperation(value = "CK-API验证测试", notes = "API-POST验证测试")
    public R check(@RequestBody String  jsonString) {
        //String转json
        JSONObject obj=JSONObject.parseObject(jsonString);
        log.debug("request:select======" + obj);
        return R.data(ckTestService.selectCount());
    }

    @ResponseBody
    @GetMapping("/checkGet")
    @ApiOperation(value = "CK-API验证测试", notes = "API-GET验证测试")
    public R checkGet() {
        log.debug("request:select======" );
        return R.data(ckTestService.selectCount());

    }


}
